<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.a3{
				display: none;
				position: absolute;
				top:200px;
				left: 200px;
			}
		</style>
	</head>
	<body>
		<div class="a1">
			<div>
				<span></span>
				<span></span>
			</div>
		</div>
		<button class="a2">放款用途</button>
		<div class="a3">
			<input type="text" id="aa" value="" />
			<input type="text" name="bb" id="bb" value="" />
			<button class="cc">提交</button>
		</div>
	</body>
	<script src="bower_components/jquery/dist/jquery.js"></script>
	<script type="text/javascript">
		var arr = {};
		$('.a2').click(function(){
			$('.a3').show();
		})
		$('.cc').click(function(){
			$('.a3').hide();
			var html='<div><span>' + $('#aa').val() + '</span><span>' + $('#bb').val() + '</span></div>';
			$('.a1').html($('.a1').html() + html);
			var a = $('#aa').val();
			var b = $('#bb').val();
			if(a in arr){//判断要添加的属性在不在对象中，如果在将添加的属性值拼接到对象中，如果属性不在对象中就直接添加 
				var str = [];
				str.push(arr[a],b);
				console.log(b)
				console.log(arr[a])
				arr[a] = str
				console.log(str)
			}else{
				arr[a] = b
			}
			
			//console.log(arr);
			$('#aa').val('');
			$('#bb').val('');
			
		})
	</script>
</html>
